class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: C = None
        self.s: E = None
        self.t: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: H = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: G = None
        self.w: B = None
        self.p: F = None
        self.x: C = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: F = None
        self.t: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: G = None
        self.txt = txt

c = A("c")
d = B("d")
j = C("j")
n = D("n")
b = E("b")
f = F("f")
l = G("l")
g = H("g")
e = A("e")

c.q = f
c.x = j
c.s = b
c.t = e
d.s = c
d.t = e
d.p = n
j.v = n
j.y = g
j.u = d
n.y = g
n.t = l
n.w = d
n.p = f
n.x = j
n.o = j
b.p = d
b.x = j
f.r = n
f.z = b
f.t = l
l.q = c
l.z = f
l.t = d
g.v = c
g.q = l
e.q = f
e.x = j
e.s = b
e.t = c
assert b.p.p.p.r.x.y.q.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: C = None
        self.s: E = None
        self.t: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: H = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: G = None
        self.w: B = None
        self.p: F = None
        self.x: C = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: F = None
        self.t: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: G = None
        self.txt = txt

c = A("c")
d = B("d")
j = C("j")
n = D("n")
b = E("b")
f = F("f")
l = G("l")
g = H("g")
e = A("e")

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