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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: C = None
        self.w: A = None
        self.s: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: C = None
        self.q: A = None
        self.t: B = None
        self.o: C = None
        self.txt = txt

h = A("h")
f = B("f")
m = C("m")
j = D("j")
a = E("a")
l = F("l")
k = G("k")

h.o = a
h.u = a
h.t = f
f.y = j
f.p = j
f.z = l
f.r = h
f.o = h
m.p = j
m.w = h
j.p = h
j.w = h
j.o = m
j.s = m
a.s = l
a.t = k
l.v = m
l.w = j
k.w = h
k.q = h
k.y = m
k.o = m
k.t = f
assert a.s.w.w.o.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: B = None
        self.u: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: C = None
        self.w: A = None
        self.s: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: C = None
        self.q: A = None
        self.t: B = None
        self.o: C = None
        self.txt = txt

h = A("h")
f = B("f")
m = C("m")
j = D("j")
a = E("a")
l = F("l")
k = G("k")

h.o = a
h.u = a
h.t = f
f.y = j
f.p = j
f.z = l
f.r = h
f.o = h
m.p = j
m.w = h
j.p = h
j.w = h
j.o = m
j.s = m
a.s = l
a.t = k
l.v = m
l.w = j
k.w = h
k.q = h
k.y = m
k.o = m
k.t = f
assert a.s.w.w.o.t.y.txt == "m"