class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: A = None
        self.z: E = None
        self.x: E = None
        self.w: F = None
        self.txt = txt

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

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

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

e = A("e")
n = B("n")
k = C("k")
h = D("h")
m = E("m")
f = F("f")
l = G("l")
c = F("c")
d = G("d")

e.r = h
n.y = m
k.z = n
k.t = d
k.u = c
h.o = l
h.s = e
h.z = m
h.x = m
h.w = c
m.w = n
m.t = n
m.o = c
m.u = c
m.y = k
m.r = h
f.u = l
f.x = c
l.y = n
c.u = l
c.x = f
d.y = n
assert h.o.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: A = None
        self.z: E = None
        self.x: E = None
        self.w: F = None
        self.txt = txt

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

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

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

e = A("e")
n = B("n")
k = C("k")
h = D("h")
m = E("m")
f = F("f")
l = G("l")
c = F("c")
d = G("d")

e.r = h
n.y = m
k.z = n
k.t = d
k.u = c
h.o = l
h.s = e
h.z = m
h.x = m
h.w = c
m.w = n
m.t = n
m.o = c
m.u = c
m.y = k
m.r = h
f.u = l
f.x = c
l.y = n
c.u = l
c.x = f
d.y = n
assert h.o.y.y.txt == "m"