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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: F = None
        self.x: B = None
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.s: D = None
        self.z: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: F = None
        self.x: B = None
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.s: D = None
        self.z: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: G = None
        self.txt = txt

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

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

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