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

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

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

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

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

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

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

b.p = f
b.q = e
b.s = e
b.z = j
b.x = a
a.p = b
a.s = e
f.p = l
f.z = l
f.x = b
f.y = b
c.s = a
c.u = b
c.y = j
e.w = l
e.z = f
e.p = a
l.s = f
l.u = f
l.v = c
l.t = b
l.x = a
l.q = a
j.s = a
j.u = b
j.y = c
assert b.x.s.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: E = None
        self.s: E = None
        self.z: D = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

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

b.p = f
b.q = e
b.s = e
b.z = j
b.x = a
a.p = b
a.s = e
f.p = l
f.z = l
f.x = b
f.y = b
c.s = a
c.u = b
c.y = j
e.w = l
e.z = f
e.p = a
l.s = f
l.u = f
l.v = c
l.t = b
l.x = a
l.q = a
j.s = a
j.u = b
j.y = c
assert b.x.s.z.y.txt == "b"