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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: D = None
        self.z: D = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: D = None
        self.z: D = None
        self.x: B = None
        self.txt = txt

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

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