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

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

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

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

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

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

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

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

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

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

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

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

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

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

j.o = l
j.s = l
j.w = n
j.u = n
j.x = b
j.p = k
b.w = k
a.v = j
a.u = j
a.o = d
a.p = b
d.p = b
d.r = b
n.z = j
n.s = b
n.u = d
n.x = a
n.q = k
k.w = j
k.r = a
k.y = b
k.o = b
l.v = j
l.u = j
l.o = d
l.p = b
assert d.r.w.r.p.w.txt == "k"