class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: B = None
        self.v: A = None
        self.z: C = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

h.u = a
h.x = a
h.v = f
h.z = d
h.o = l
a.u = g
a.s = c
a.q = d
d.z = f
d.t = h
g.q = a
g.r = d
g.x = c
g.s = f
l.q = h
l.s = f
c.p = d
c.z = a
f.u = a
f.x = a
f.v = h
f.z = d
f.o = l
assert c.z.u.x.p.t.txt == "h"