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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: D = None
        self.s: C = None
        self.txt = txt

c = A("c")
i = B("i")
d = C("d")
h = D("h")
e = E("e")
l = F("l")
j = D("j")

c.t = j
c.v = j
c.u = l
c.z = d
i.y = c
d.u = i
d.v = e
h.v = d
h.r = j
e.z = l
l.v = h
l.q = j
l.s = d
j.v = d
j.r = h
assert i.y.u.q.v.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: F = None
        self.z: C = None
        self.v: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: D = None
        self.s: C = None
        self.txt = txt

c = A("c")
i = B("i")
d = C("d")
h = D("h")
e = E("e")
l = F("l")
j = D("j")

c.t = j
c.v = j
c.u = l
c.z = d
i.y = c
d.u = i
d.v = e
h.v = d
h.r = j
e.z = l
l.v = h
l.q = j
l.s = d
j.v = d
j.r = h
assert i.y.u.q.v.u.y.txt == "c"