class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: J = None
        self.y: D = None
        self.q: D = None
        self.u: D = None
        self.s: E = None
        self.z: J = None
        self.r: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: J = None
        self.u: J = None
        self.t: G = None
        self.x: B = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: D = None
        self.p: J = None
        self.w: I = None
        self.o: I = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: D = None
        self.z: E = None
        self.q: G = None
        self.p: E = None
        self.o: I = None
        self.u: G = None
        self.t: A = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: B = None
        self.s: J = None
        self.v: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: H = None
        self.t: D = None
        self.u: I = None
        self.y: F = None
        self.v: I = None
        self.o: C = None
        self.q: F = None
        self.txt = txt

e = A("e")
c = B("c")
d = C("d")
a = D("a")
g = E("g")
b = F("b")
j = G("j")
n = H("n")
f = I("f")
m = J("m")

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: J = None
        self.u: J = None
        self.t: G = None
        self.x: B = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: D = None
        self.p: J = None
        self.w: I = None
        self.o: I = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: D = None
        self.z: E = None
        self.q: G = None
        self.p: E = None
        self.o: I = None
        self.u: G = None
        self.t: A = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: B = None
        self.s: J = None
        self.v: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: H = None
        self.t: D = None
        self.u: I = None
        self.y: F = None
        self.v: I = None
        self.o: C = None
        self.q: F = None
        self.txt = txt

e = A("e")
c = B("c")
d = C("d")
a = D("a")
g = E("g")
b = F("b")
j = G("j")
n = H("n")
f = I("f")
m = J("m")

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