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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: E = None
        self.s: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: E = None
        self.s: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

a.o = i
a.z = i
a.r = i
g.o = k
g.u = k
g.s = i
g.q = i
i.y = e
i.v = k
i.q = c
c.p = i
k.r = f
k.w = f
e.w = k
e.p = k
e.q = c
e.v = f
f.o = i
f.z = i
f.r = i
n.p = i
assert g.o.w.o.q.p.v.r.r.txt == "i"