class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: G = None
        self.r: F = None
        self.v: D = None
        self.t: E = None
        self.u: G = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: D = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: G = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: C = None
        self.q: G = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: A = None
        self.w: A = None
        self.v: A = None
        self.o: C = None
        self.y: A = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: D = None
        self.txt = txt

l = A("l")
m = B("m")
n = C("n")
e = D("e")
b = E("b")
j = F("j")
i = G("i")
f = G("f")

l.p = f
m.w = n
m.z = n
m.x = i
m.u = i
m.r = j
m.v = e
m.t = b
n.q = b
n.z = b
n.w = e
e.p = l
e.z = l
e.t = i
b.u = j
b.y = n
b.q = i
b.s = e
j.p = n
j.o = n
j.q = n
j.s = l
j.w = l
j.v = l
j.y = l
i.v = b
i.z = e
f.v = b
f.z = e
assert m.r.p.w.p.p.v.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: G = None
        self.r: F = None
        self.v: D = None
        self.t: E = None
        self.u: G = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: D = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: G = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: C = None
        self.q: G = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: A = None
        self.w: A = None
        self.v: A = None
        self.o: C = None
        self.y: A = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: D = None
        self.txt = txt

l = A("l")
m = B("m")
n = C("n")
e = D("e")
b = E("b")
j = F("j")
i = G("i")
f = G("f")

l.p = f
m.w = n
m.z = n
m.x = i
m.u = i
m.r = j
m.v = e
m.t = b
n.q = b
n.z = b
n.w = e
e.p = l
e.z = l
e.t = i
b.u = j
b.y = n
b.q = i
b.s = e
j.p = n
j.o = n
j.q = n
j.s = l
j.w = l
j.v = l
j.y = l
i.v = b
i.z = e
f.v = b
f.z = e
assert m.r.p.w.p.p.v.u.p.txt == "n"