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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: E = None
        self.x: A = None
        self.t: D = None
        self.v: D = None
        self.o: H = None
        self.s: H = None
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: E = None
        self.t: D = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: I = None
        self.r: G = None
        self.o: C = None
        self.w: A = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: H = None
        self.w: A = None
        self.u: B = None
        self.v: H = None
        self.r: C = None
        self.q: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: F = None
        self.x: E = None
        self.z: B = None
        self.s: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: E = None
        self.x: A = None
        self.t: D = None
        self.v: D = None
        self.o: H = None
        self.s: H = None
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: E = None
        self.t: D = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: I = None
        self.r: G = None
        self.o: C = None
        self.w: A = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: H = None
        self.w: A = None
        self.u: B = None
        self.v: H = None
        self.r: C = None
        self.q: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: F = None
        self.x: E = None
        self.z: B = None
        self.s: G = None
        self.txt = txt

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

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

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