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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: E = None
        self.o: E = None
        self.p: F = None
        self.r: F = None
        self.y: B = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

k.t = c
k.u = e
k.v = a
c.w = k
c.q = a
c.o = a
c.p = n
c.r = n
c.y = h
f.t = c
i.t = k
i.r = f
i.x = a
a.z = c
a.p = f
d.r = k
e.r = k
n.r = k
b.w = k
b.q = a
b.o = a
b.p = n
b.r = e
b.y = h
h.w = k
h.q = a
h.o = a
h.p = e
h.r = n
h.y = b
assert h.o.z.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: F = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: E = None
        self.o: E = None
        self.p: F = None
        self.r: F = None
        self.y: B = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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