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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

f = A("f")
c = B("c")
l = C("l")
k = D("k")
a = E("a")
j = F("j")

f.u = l
f.o = j
c.y = a
l.t = j
l.x = k
l.z = a
l.y = f
k.t = j
k.w = l
k.u = c
k.z = c
k.q = f
a.y = k
j.u = k
j.w = a
j.v = a
j.y = a
j.s = c
assert a.y.w.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

f = A("f")
c = B("c")
l = C("l")
k = D("k")
a = E("a")
j = F("j")

f.u = l
f.o = j
c.y = a
l.t = j
l.x = k
l.z = a
l.y = f
k.t = j
k.w = l
k.u = c
k.z = c
k.q = f
a.y = k
j.u = k
j.w = a
j.v = a
j.y = a
j.s = c
assert a.y.w.x.q.txt == "f"