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

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

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

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

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

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

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

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

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

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

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

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

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

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

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