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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: D = None
        self.p: B = None
        self.s: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: D = None
        self.x: E = None
        self.q: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: D = None
        self.p: B = None
        self.s: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: D = None
        self.x: E = None
        self.q: B = None
        self.txt = txt

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

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