class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: A = None
        self.p: D = None
        self.r: E = None
        self.o: A = None
        self.u: F = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: G = None
        self.x: F = None
        self.v: F = None
        self.u: B = None
        self.w: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: B = None
        self.r: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

h = A("h")
b = B("b")
k = C("k")
a = D("a")
m = E("m")
c = F("c")
l = G("l")
i = E("i")
e = D("e")

h.u = m
h.p = k
b.y = i
b.r = i
b.s = h
b.o = h
b.p = a
b.u = c
b.t = c
k.z = e
k.q = l
k.x = c
k.v = c
k.u = b
k.w = a
a.x = k
m.q = c
m.z = b
m.r = i
c.y = i
c.w = h
l.v = b
i.q = c
i.z = b
i.r = m
e.x = k
assert k.u.t.y.r.z.o.u.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: A = None
        self.p: D = None
        self.r: E = None
        self.o: A = None
        self.u: F = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: G = None
        self.x: F = None
        self.v: F = None
        self.u: B = None
        self.w: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: B = None
        self.r: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

h = A("h")
b = B("b")
k = C("k")
a = D("a")
m = E("m")
c = F("c")
l = G("l")
i = E("i")
e = D("e")

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