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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: D = None
        self.z: C = None
        self.y: C = None
        self.r: D = None
        self.txt = txt

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

h = A("h")
k = B("k")
l = C("l")
e = D("e")
c = E("c")
a = F("a")
b = B("b")
j = C("j")

h.t = l
k.t = c
k.r = h
l.o = e
e.w = a
e.z = h
e.v = c
c.p = e
c.t = e
c.r = e
c.z = l
c.y = l
a.u = b
a.t = b
a.p = e
a.w = e
a.v = c
b.t = c
b.r = h
j.o = e
assert b.r.t.o.v.z.o.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: D = None
        self.z: C = None
        self.y: C = None
        self.r: D = None
        self.txt = txt

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

h = A("h")
k = B("k")
l = C("l")
e = D("e")
c = E("c")
a = F("a")
b = B("b")
j = C("j")

h.t = l
k.t = c
k.r = h
l.o = e
e.w = a
e.z = h
e.v = c
c.p = e
c.t = e
c.r = e
c.z = l
c.y = l
a.u = b
a.t = b
a.p = e
a.w = e
a.v = c
b.t = c
b.r = h
j.o = e
assert b.r.t.o.v.z.o.w.v.txt == "c"