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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

b.q = d
b.x = d
b.t = n
c.v = e
c.q = d
c.x = i
c.o = k
c.w = b
n.s = k
e.q = c
i.z = d
d.o = g
d.t = i
k.v = a
k.q = d
k.x = i
k.o = c
k.w = b
l.s = c
a.q = k
g.s = k
assert d.t.z.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: F = None
        self.t: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

b.q = d
b.x = d
b.t = n
c.v = e
c.q = d
c.x = i
c.o = k
c.w = b
n.s = k
e.q = c
i.z = d
d.o = g
d.t = i
k.v = a
k.q = d
k.x = i
k.o = c
k.w = b
l.s = c
a.q = k
g.s = k
assert d.t.z.o.s.txt == "k"