class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.w: E = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: E = None
        self.q: E = None
        self.u: F = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: D = None
        self.r: I = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.x: F = None
        self.u: B = None
        self.p: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: J = None
        self.z: G = None
        self.y: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: F = None
        self.z: A = None
        self.q: H = None
        self.o: H = None
        self.s: E = None
        self.u: B = None
        self.r: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: I = None
        self.r: D = None
        self.o: B = None
        self.t: G = None
        self.q: E = None
        self.x: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: E = None
        self.q: E = None
        self.u: F = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: D = None
        self.r: I = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.x: F = None
        self.u: B = None
        self.p: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: J = None
        self.z: G = None
        self.y: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: F = None
        self.z: A = None
        self.q: H = None
        self.o: H = None
        self.s: E = None
        self.u: B = None
        self.r: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: I = None
        self.r: D = None
        self.o: B = None
        self.t: G = None
        self.q: E = None
        self.x: D = None
        self.txt = txt

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

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