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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: D = None
        self.v: D = None
        self.txt = txt

c = A("c")
a = B("a")
l = C("l")
d = D("d")
f = E("f")
m = F("m")
j = B("j")
g = D("g")
i = D("i")
k = C("k")

c.r = k
a.s = f
l.z = m
l.q = k
l.u = a
l.s = c
d.v = m
d.w = m
d.r = g
d.y = g
d.u = l
f.r = l
m.o = c
m.t = d
m.v = d
j.s = f
g.v = m
g.w = m
g.r = d
g.u = l
g.y = i
i.v = m
i.w = m
i.r = d
i.u = k
i.y = g
k.z = m
k.q = l
k.u = a
k.s = c
assert g.w.o.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: D = None
        self.v: D = None
        self.txt = txt

c = A("c")
a = B("a")
l = C("l")
d = D("d")
f = E("f")
m = F("m")
j = B("j")
g = D("g")
i = D("i")
k = C("k")

c.r = k
a.s = f
l.z = m
l.q = k
l.u = a
l.s = c
d.v = m
d.w = m
d.r = g
d.y = g
d.u = l
f.r = l
m.o = c
m.t = d
m.v = d
j.s = f
g.v = m
g.w = m
g.r = d
g.u = l
g.y = i
i.v = m
i.w = m
i.r = d
i.u = k
i.y = g
k.z = m
k.q = l
k.u = a
k.s = c
assert g.w.o.r.z.txt == "m"