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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: B = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: B = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: G = None
        self.p: H = None
        self.y: G = None
        self.r: A = None
        self.txt = txt

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

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

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

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

i = A("i")
e = B("e")
d = C("d")
f = D("f")
a = E("a")
g = F("g")
j = G("j")
b = H("b")
m = I("m")

i.s = e
i.u = m
e.v = m
e.p = j
e.x = j
e.t = d
d.s = j
d.u = e
d.w = g
f.z = g
f.v = e
f.w = a
a.w = f
a.v = j
a.y = j
a.p = b
a.r = i
g.u = f
j.y = m
b.o = g
b.u = i
m.o = g
assert a.p.o.u.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: B = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: B = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: G = None
        self.p: H = None
        self.y: G = None
        self.r: A = None
        self.txt = txt

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

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

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

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

i = A("i")
e = B("e")
d = C("d")
f = D("f")
a = E("a")
g = F("g")
j = G("j")
b = H("b")
m = I("m")

i.s = e
i.u = m
e.v = m
e.p = j
e.x = j
e.t = d
d.s = j
d.u = e
d.w = g
f.z = g
f.v = e
f.w = a
a.w = f
a.v = j
a.y = j
a.p = b
a.r = i
g.u = f
j.y = m
b.o = g
b.u = i
m.o = g
assert a.p.o.u.z.u.txt == "f"