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

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: F = None
        self.o: C = None
        self.y: C = None
        self.t: G = None
        self.u: C = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: F = None
        self.o: C = None
        self.y: C = None
        self.t: G = None
        self.u: C = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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