class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: E = None
        self.u: F = None
        self.y: B = None
        self.q: D = None
        self.s: G = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: B = None
        self.z: G = None
        self.p: D = None
        self.o: D = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

b = A("b")
n = B("n")
k = C("k")
c = D("c")
m = E("m")
j = F("j")
d = G("d")
e = C("e")
i = C("i")

b.p = d
b.s = d
b.t = m
b.u = j
b.y = n
b.r = n
b.q = c
n.v = m
k.y = n
k.q = n
k.z = d
k.x = d
k.p = c
k.o = c
c.w = d
m.w = j
j.u = n
d.u = c
d.p = c
d.z = m
e.y = n
e.q = n
e.z = d
e.x = d
e.p = c
e.o = c
i.y = n
i.q = n
i.z = d
i.x = d
i.p = c
i.o = c
assert j.u.v.w.u.v.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: E = None
        self.u: F = None
        self.y: B = None
        self.q: D = None
        self.s: G = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: B = None
        self.z: G = None
        self.p: D = None
        self.o: D = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

b = A("b")
n = B("n")
k = C("k")
c = D("c")
m = E("m")
j = F("j")
d = G("d")
e = C("e")
i = C("i")

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