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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: C = None
        self.z: D = None
        self.p: D = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: A = None
        self.r: H = None
        self.p: G = None
        self.o: A = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: I = None
        self.y: B = None
        self.z: F = None
        self.p: I = None
        self.o: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: D = None
        self.r: C = None
        self.u: C = None
        self.s: D = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: C = None
        self.z: D = None
        self.p: D = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: A = None
        self.r: H = None
        self.p: G = None
        self.o: A = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: I = None
        self.y: B = None
        self.z: F = None
        self.p: I = None
        self.o: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: D = None
        self.r: C = None
        self.u: C = None
        self.s: D = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: G = None
        self.txt = txt

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

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

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