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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: C = None
        self.o: F = None
        self.z: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: D = None
        self.v: D = None
        self.q: E = None
        self.u: D = None
        self.txt = txt

b = A("b")
l = B("l")
k = C("k")
e = D("e")
g = E("g")
n = F("n")

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: C = None
        self.o: F = None
        self.z: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: D = None
        self.v: D = None
        self.q: E = None
        self.u: D = None
        self.txt = txt

b = A("b")
l = B("l")
k = C("k")
e = D("e")
g = E("g")
n = F("n")

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