class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: D = None
        self.r: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: H = None
        self.x: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: B = None
        self.v: E = None
        self.t: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: D = None
        self.r: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: H = None
        self.x: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: B = None
        self.v: E = None
        self.t: D = None
        self.txt = txt

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

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

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