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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: B = None
        self.r: E = None
        self.y: D = None
        self.v: B = None
        self.u: D = None
        self.txt = txt

f = A("f")
c = B("c")
i = C("i")
b = D("b")
j = E("j")
l = F("l")

f.u = i
c.x = b
c.q = l
i.u = f
i.x = f
i.y = b
b.s = l
b.z = l
b.u = c
b.y = i
b.p = i
b.w = j
j.z = b
l.z = f
l.p = c
l.v = c
l.r = j
l.y = b
l.u = b
assert j.z.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: B = None
        self.r: E = None
        self.y: D = None
        self.v: B = None
        self.u: D = None
        self.txt = txt

f = A("f")
c = B("c")
i = C("i")
b = D("b")
j = E("j")
l = F("l")

f.u = i
c.x = b
c.q = l
i.u = f
i.x = f
i.y = b
b.s = l
b.z = l
b.u = c
b.y = i
b.p = i
b.w = j
j.z = b
l.z = f
l.p = c
l.v = c
l.r = j
l.y = b
l.u = b
assert j.z.y.y.txt == "b"