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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: I = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: E = None
        self.v: G = None
        self.t: H = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: F = None
        self.r: C = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: H = None
        self.u: D = None
        self.y: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: E = None
        self.w: H = None
        self.q: F = None
        self.t: H = None
        self.p: B = None
        self.o: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: I = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: E = None
        self.v: G = None
        self.t: H = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: F = None
        self.r: C = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: H = None
        self.u: D = None
        self.y: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: E = None
        self.w: H = None
        self.q: F = None
        self.t: H = None
        self.p: B = None
        self.o: D = None
        self.txt = txt

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

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