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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: A = None
        self.v: E = None
        self.q: A = None
        self.z: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

d = A("d")
g = B("g")
k = C("k")
b = D("b")
l = E("l")
f = F("f")

d.u = b
d.s = b
d.p = l
g.y = l
g.v = l
g.z = l
g.t = d
g.q = d
k.o = b
k.s = d
k.t = d
k.u = l
k.z = l
k.v = g
b.t = g
l.p = f
f.w = d
f.z = k
f.s = g
f.x = b
assert b.t.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: E = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: A = None
        self.v: E = None
        self.q: A = None
        self.z: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

d = A("d")
g = B("g")
k = C("k")
b = D("b")
l = E("l")
f = F("f")

d.u = b
d.s = b
d.p = l
g.y = l
g.v = l
g.z = l
g.t = d
g.q = d
k.o = b
k.s = d
k.t = d
k.u = l
k.z = l
k.v = g
b.t = g
l.p = f
f.w = d
f.z = k
f.s = g
f.x = b
assert b.t.q.p.txt == "l"