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

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

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

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

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

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

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

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

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

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

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

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

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

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

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