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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: A = None
        self.z: F = None
        self.txt = txt

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

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

g.o = c
g.p = n
m.x = k
i.v = n
n.v = c
n.r = k
k.r = g
k.u = g
k.z = b
f.q = k
f.w = e
c.v = n
j.x = k
e.q = k
e.w = f
b.q = k
b.w = f
assert c.v.r.u.o.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: A = None
        self.z: F = None
        self.txt = txt

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

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

g.o = c
g.p = n
m.x = k
i.v = n
n.v = c
n.r = k
k.r = g
k.u = g
k.z = b
f.q = k
f.w = e
c.v = n
j.x = k
e.q = k
e.w = f
b.q = k
b.w = f
assert c.v.r.u.o.v.v.v.txt == "n"