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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: F = None
        self.z: B = None
        self.q: B = None
        self.txt = txt

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

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

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

b = A("b")
j = B("j")
k = C("k")
h = D("h")
l = E("l")
n = F("n")

b.w = n
b.x = n
b.p = k
b.u = k
j.x = l
j.u = b
j.w = n
k.v = n
k.p = n
k.z = j
k.q = j
h.q = n
h.z = j
h.r = j
l.t = j
l.u = b
l.v = b
l.z = b
l.w = k
n.u = b
n.v = b
n.y = h
assert l.t.u.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: F = None
        self.p: C = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: F = None
        self.z: B = None
        self.q: B = None
        self.txt = txt

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

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

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

b = A("b")
j = B("j")
k = C("k")
h = D("h")
l = E("l")
n = F("n")

b.w = n
b.x = n
b.p = k
b.u = k
j.x = l
j.u = b
j.w = n
k.v = n
k.p = n
k.z = j
k.q = j
h.q = n
h.z = j
h.r = j
l.t = j
l.u = b
l.v = b
l.z = b
l.w = k
n.u = b
n.v = b
n.y = h
assert l.t.u.x.u.txt == "b"