class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: E = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: E = None
        self.o: E = None
        self.q: C = None
        self.txt = txt

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

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

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

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

h = A("h")
a = B("a")
g = C("g")
c = D("c")
b = E("b")
i = F("i")
f = D("f")
l = D("l")

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: E = None
        self.o: E = None
        self.q: C = None
        self.txt = txt

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

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

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

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

h = A("h")
a = B("a")
g = C("g")
c = D("c")
b = E("b")
i = F("i")
f = D("f")
l = D("l")

h.q = a
h.t = a
h.p = b
a.r = h
a.p = b
a.o = b
a.q = g
g.z = b
g.x = h
g.v = h
g.p = h
g.r = f
g.o = i
c.p = i
c.u = i
c.o = h
c.y = b
c.t = b
c.w = g
b.y = g
b.o = g
b.w = h
b.t = a
i.y = b
i.u = b
i.z = g
i.t = g
i.w = h
i.q = c
f.p = i
f.u = i
f.o = h
f.y = b
f.t = b
f.w = g
l.p = i
l.u = i
l.o = h
l.y = b
l.t = b
l.w = g
assert h.t.r.q.txt == "a"