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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: F = None
        self.y: E = None
        self.s: E = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: A = None
        self.o: E = None
        self.r: E = None
        self.q: E = None
        self.s: A = None
        self.y: H = None
        self.z: G = None
        self.txt = txt

c = A("c")
d = B("d")
e = C("e")
n = D("n")
h = E("h")
l = F("l")
b = G("b")
a = H("a")
g = I("g")

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: F = None
        self.y: E = None
        self.s: E = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: A = None
        self.o: E = None
        self.r: E = None
        self.q: E = None
        self.s: A = None
        self.y: H = None
        self.z: G = None
        self.txt = txt

c = A("c")
d = B("d")
e = C("e")
n = D("n")
h = E("h")
l = F("l")
b = G("b")
a = H("a")
g = I("g")

c.u = g
d.u = n
e.t = b
e.x = l
e.u = l
e.y = h
e.s = h
n.u = b
n.y = l
h.r = g
l.t = h
l.u = h
l.q = d
l.p = d
l.o = b
l.x = b
l.s = e
b.y = c
b.r = c
b.q = g
b.v = n
a.s = b
a.u = b
a.v = h
a.y = h
a.o = d
a.x = d
a.r = e
a.q = n
a.p = g
g.x = a
g.y = a
g.w = c
g.s = c
g.o = h
g.r = h
g.q = h
g.z = b
assert e.s.r.z.q.o.r.txt == "g"