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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: H = None
        self.u: E = None
        self.o: E = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: F = None
        self.v: B = None
        self.p: D = None
        self.o: B = None
        self.r: D = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: C = None
        self.o: G = None
        self.p: C = None
        self.x: B = None
        self.txt = txt

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

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

h.r = a
a.q = k
a.p = f
a.u = l
a.o = l
a.v = l
g.t = h
g.x = j
g.v = a
g.o = a
g.p = k
g.r = k
k.t = j
l.r = g
l.p = g
j.y = h
j.w = h
d.t = a
d.u = f
d.v = e
f.q = d
f.o = d
f.t = g
f.p = g
f.x = a
e.y = h
e.v = j
e.u = g
assert j.y.r.q.t.y.r.p.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: H = None
        self.u: E = None
        self.o: E = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: F = None
        self.v: B = None
        self.p: D = None
        self.o: B = None
        self.r: D = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: C = None
        self.o: G = None
        self.p: C = None
        self.x: B = None
        self.txt = txt

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

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

h.r = a
a.q = k
a.p = f
a.u = l
a.o = l
a.v = l
g.t = h
g.x = j
g.v = a
g.o = a
g.p = k
g.r = k
k.t = j
l.r = g
l.p = g
j.y = h
j.w = h
d.t = a
d.u = f
d.v = e
f.q = d
f.o = d
f.t = g
f.p = g
f.x = a
e.y = h
e.v = j
e.u = g
assert j.y.r.q.t.y.r.p.t.p.txt == "k"