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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: A = None
        self.u: C = None
        self.q: E = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: A = None
        self.u: C = None
        self.q: E = None
        self.r: F = None
        self.txt = txt

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

d.o = n
k.s = m
k.t = m
k.r = f
k.q = l
l.z = k
l.t = k
l.q = m
n.p = g
n.r = l
n.o = m
c.w = l
c.t = m
c.r = f
c.x = n
a.v = c
a.t = g
a.u = l
a.q = m
a.r = b
m.w = l
m.t = c
m.r = f
m.x = f
b.v = c
b.t = d
b.u = l
b.q = m
b.r = a
f.p = d
f.r = l
f.o = m
g.o = f
assert a.v.r.o.w.t.r.p.o.r.txt == "l"