class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: D = None
        self.q: C = None
        self.t: F = None
        self.x: C = None
        self.y: C = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

h = A("h")
e = B("e")
f = C("f")
c = D("c")
g = E("g")
k = F("k")
a = G("a")
i = B("i")

h.y = e
e.s = i
e.v = c
e.q = f
e.x = f
e.y = f
e.t = k
e.w = g
f.z = k
c.s = k
c.q = h
g.u = c
g.y = a
k.s = g
a.x = g
i.s = e
i.v = c
i.q = f
i.x = f
i.y = f
i.t = k
i.w = g
assert e.t.s.y.x.y.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: D = None
        self.q: C = None
        self.t: F = None
        self.x: C = None
        self.y: C = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

h = A("h")
e = B("e")
f = C("f")
c = D("c")
g = E("g")
k = F("k")
a = G("a")
i = B("i")

h.y = e
e.s = i
e.v = c
e.q = f
e.x = f
e.y = f
e.t = k
e.w = g
f.z = k
c.s = k
c.q = h
g.u = c
g.y = a
k.s = g
a.x = g
i.s = e
i.v = c
i.q = f
i.x = f
i.y = f
i.t = k
i.w = g
assert e.t.s.y.x.y.x.u.txt == "c"