class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: B = None
        self.q: B = None
        self.x: C = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: B = None
        self.q: B = None
        self.x: C = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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