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

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

class C:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: E = None
        self.s: E = None
        self.x: E = None
        self.u: C = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: E = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: E = None
        self.txt = txt

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

k = A("k")
e = B("e")
c = C("c")
g = D("g")
d = E("d")
m = F("m")
h = B("h")
f = C("f")
j = B("j")
b = E("b")

k.p = g
e.y = m
c.v = f
c.u = f
c.p = d
c.s = b
c.x = b
c.y = m
g.o = k
g.q = d
g.t = b
d.y = b
d.s = b
m.z = d
m.o = h
h.y = m
f.v = c
f.u = c
f.p = b
f.s = b
f.x = b
f.y = m
j.y = m
b.y = d
b.s = d
assert k.p.o.p.t.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: E = None
        self.s: E = None
        self.x: E = None
        self.u: C = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: E = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: E = None
        self.txt = txt

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

k = A("k")
e = B("e")
c = C("c")
g = D("g")
d = E("d")
m = F("m")
h = B("h")
f = C("f")
j = B("j")
b = E("b")

k.p = g
e.y = m
c.v = f
c.u = f
c.p = d
c.s = b
c.x = b
c.y = m
g.o = k
g.q = d
g.t = b
d.y = b
d.s = b
m.z = d
m.o = h
h.y = m
f.v = c
f.u = c
f.p = b
f.s = b
f.x = b
f.y = m
j.y = m
b.y = d
b.s = d
assert k.p.o.p.t.y.y.y.txt == "d"