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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: C = None
        self.y: A = None
        self.s: H = None
        self.q: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: H = None
        self.v: A = None
        self.u: F = None
        self.q: D = None
        self.s: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: C = None
        self.v: C = None
        self.t: E = None
        self.x: I = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: C = None
        self.y: A = None
        self.s: H = None
        self.q: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: H = None
        self.v: A = None
        self.u: F = None
        self.q: D = None
        self.s: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: C = None
        self.v: C = None
        self.t: E = None
        self.x: I = None
        self.txt = txt

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

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

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

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

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