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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: C = None
        self.q: A = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: A = None
        self.t: F = None
        self.q: B = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: B = None
        self.v: B = None
        self.y: C = None
        self.w: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: C = None
        self.q: A = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: A = None
        self.t: F = None
        self.q: B = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: B = None
        self.v: B = None
        self.y: C = None
        self.w: C = None
        self.txt = txt

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

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

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