class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: D = None
        self.r: B = None
        self.p: B = None
        self.q: C = None
        self.t: G = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: G = None
        self.q: F = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.v: H = None
        self.o: H = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: A = None
        self.z: H = None
        self.u: G = None
        self.r: F = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: H = None
        self.v: C = None
        self.s: D = None
        self.z: A = None
        self.r: D = None
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: B = None
        self.y: I = None
        self.r: B = None
        self.u: H = None
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: H = None
        self.u: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: G = None
        self.q: F = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.v: H = None
        self.o: H = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: A = None
        self.z: H = None
        self.u: G = None
        self.r: F = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: H = None
        self.v: C = None
        self.s: D = None
        self.z: A = None
        self.r: D = None
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: B = None
        self.y: I = None
        self.r: B = None
        self.u: H = None
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: H = None
        self.u: E = None
        self.txt = txt

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

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