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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: A = None
        self.o: A = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: A = None
        self.o: A = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

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

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