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

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

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: F = None
        self.t: I = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: C = None
        self.t: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: D = None
        self.w: F = None
        self.t: A = None
        self.y: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: F = None
        self.t: I = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: C = None
        self.t: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: D = None
        self.w: F = None
        self.t: A = None
        self.y: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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