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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: B = None
        self.u: A = None
        self.q: B = None
        self.y: A = None
        self.x: A = None
        self.txt = txt

h = A("h")
i = B("i")
k = C("k")
a = D("a")
m = E("m")
g = F("g")
l = F("l")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: B = None
        self.u: A = None
        self.q: B = None
        self.y: A = None
        self.x: A = None
        self.txt = txt

h = A("h")
i = B("i")
k = C("k")
a = D("a")
m = E("m")
g = F("g")
l = F("l")

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