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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: A = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: E = None
        self.t: D = None
        self.x: F = None
        self.u: C = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

k = A("k")
g = B("g")
h = C("h")
d = D("d")
c = E("c")
a = F("a")
e = C("e")

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: A = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: E = None
        self.t: D = None
        self.x: F = None
        self.u: C = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

k = A("k")
g = B("g")
h = C("h")
d = D("d")
c = E("c")
a = F("a")
e = C("e")

k.u = d
k.r = c
k.o = h
k.q = h
k.x = g
k.z = g
g.z = k
g.x = k
g.y = d
h.z = k
h.s = c
h.r = c
h.t = d
h.x = a
h.u = e
d.v = e
c.x = a
c.u = k
c.o = h
a.q = k
a.r = g
a.v = h
e.z = k
e.s = c
e.r = c
e.t = d
e.x = a
e.u = h
assert h.r.u.z.y.v.x.txt == "a"