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

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

class C:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: D = None
        self.t: F = None
        self.o: C = None
        self.y: B = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: D = None
        self.t: F = None
        self.o: C = None
        self.y: B = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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