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

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: G = None
        self.y: A = None
        self.o: C = None
        self.q: B = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: G = None
        self.y: A = None
        self.o: C = None
        self.q: B = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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