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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: H = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: I = None
        self.y: B = None
        self.txt = txt

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

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

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

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

c = A("c")
j = B("j")
b = C("b")
l = D("l")
h = E("h")
k = F("k")
n = G("n")
i = H("i")
a = I("a")

c.y = b
c.x = b
c.r = h
c.q = h
c.p = k
c.z = k
c.u = n
c.o = n
c.t = l
j.t = a
b.q = l
b.z = i
b.o = c
l.o = a
l.r = n
h.u = k
h.t = a
h.y = j
k.u = h
k.y = i
k.w = i
n.o = j
i.o = h
i.q = j
i.p = n
a.q = k
a.o = k
a.r = h
assert c.u.o.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: E = None
        self.p: F = None
        self.z: F = None
        self.q: E = None
        self.x: C = None
        self.u: G = None
        self.t: D = None
        self.o: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: H = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: I = None
        self.y: B = None
        self.txt = txt

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

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

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

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

c = A("c")
j = B("j")
b = C("b")
l = D("l")
h = E("h")
k = F("k")
n = G("n")
i = H("i")
a = I("a")

c.y = b
c.x = b
c.r = h
c.q = h
c.p = k
c.z = k
c.u = n
c.o = n
c.t = l
j.t = a
b.q = l
b.z = i
b.o = c
l.o = a
l.r = n
h.u = k
h.t = a
h.y = j
k.u = h
k.y = i
k.w = i
n.o = j
i.o = h
i.q = j
i.p = n
a.q = k
a.o = k
a.r = h
assert c.u.o.t.r.txt == "h"