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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: F = None
        self.z: F = None
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: G = None
        self.w: C = None
        self.o: H = None
        self.p: E = None
        self.s: F = None
        self.v: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: A = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: G = None
        self.s: B = None
        self.t: H = None
        self.p: H = None
        self.u: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: F = None
        self.z: F = None
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: G = None
        self.w: C = None
        self.o: H = None
        self.p: E = None
        self.s: F = None
        self.v: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: A = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: G = None
        self.s: B = None
        self.t: H = None
        self.p: H = None
        self.u: H = None
        self.txt = txt

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

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