class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: B = None
        self.q: B = None
        self.o: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: D = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: D = None
        self.q: E = None
        self.txt = txt

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

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

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