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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: F = None
        self.y: C = None
        self.x: G = None
        self.w: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: C = None
        self.u: D = None
        self.r: E = None
        self.w: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: F = None
        self.y: C = None
        self.x: G = None
        self.w: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: C = None
        self.u: D = None
        self.r: E = None
        self.w: D = None
        self.txt = txt

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

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

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

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