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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: B = None
        self.u: D = None
        self.t: D = None
        self.v: D = None
        self.o: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: B = None
        self.u: D = None
        self.t: D = None
        self.v: D = None
        self.o: C = None
        self.txt = txt

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

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