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

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: B = None
        self.txt = txt

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

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