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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: F = None
        self.q: D = None
        self.p: C = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

c.y = i
c.u = d
c.x = e
i.u = c
i.y = h
i.q = a
i.o = a
i.p = d
d.o = j
d.x = h
d.t = i
d.u = c
d.v = c
a.w = c
a.q = c
a.o = i
j.t = d
j.s = a
h.t = j
e.o = j
e.x = h
e.t = i
e.u = c
e.v = c
assert e.o.t.t.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: C = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: F = None
        self.q: D = None
        self.p: C = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

c.y = i
c.u = d
c.x = e
i.u = c
i.y = h
i.q = a
i.o = a
i.p = d
d.o = j
d.x = h
d.t = i
d.u = c
d.v = c
a.w = c
a.q = c
a.o = i
j.t = d
j.s = a
h.t = j
e.o = j
e.x = h
e.t = i
e.u = c
e.v = c
assert e.o.t.t.q.o.txt == "i"