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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: A = None
        self.r: E = None
        self.txt = txt

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

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

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

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

c = A("c")
k = B("k")
b = C("b")
g = D("g")
a = E("a")
l = F("l")

c.q = b
c.v = b
c.z = k
c.o = l
c.x = g
k.w = c
k.x = c
k.r = a
b.s = a
g.t = b
g.s = k
g.q = k
g.x = k
g.y = l
g.p = l
a.t = c
a.v = c
a.x = k
a.z = g
l.r = g
l.p = g
l.o = a
assert l.o.x.w.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: B = None
        self.o: F = None
        self.x: D = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: A = None
        self.r: E = None
        self.txt = txt

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

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

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

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

c = A("c")
k = B("k")
b = C("b")
g = D("g")
a = E("a")
l = F("l")

c.q = b
c.v = b
c.z = k
c.o = l
c.x = g
k.w = c
k.x = c
k.r = a
b.s = a
g.t = b
g.s = k
g.q = k
g.x = k
g.y = l
g.p = l
a.t = c
a.v = c
a.x = k
a.z = g
l.r = g
l.p = g
l.o = a
assert l.o.x.w.x.t.txt == "b"