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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: C = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: G = None
        self.y: H = None
        self.v: C = None
        self.q: G = None
        self.o: I = None
        self.z: B = None
        self.p: B = None
        self.x: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: G = None
        self.p: H = None
        self.u: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: D = None
        self.x: I = None
        self.s: F = None
        self.r: I = None
        self.u: A = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: F = None
        self.y: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: G = None
        self.w: C = None
        self.q: G = None
        self.v: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: C = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: G = None
        self.y: H = None
        self.v: C = None
        self.q: G = None
        self.o: I = None
        self.z: B = None
        self.p: B = None
        self.x: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: G = None
        self.p: H = None
        self.u: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: D = None
        self.x: I = None
        self.s: F = None
        self.r: I = None
        self.u: A = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: F = None
        self.y: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: G = None
        self.w: C = None
        self.q: G = None
        self.v: G = None
        self.txt = txt

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

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