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

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: C = None
        self.o: E = None
        self.w: F = None
        self.r: E = None
        self.txt = txt

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

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

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

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

a = A("a")
k = B("k")
m = C("m")
g = D("g")
d = E("d")
c = F("c")
l = B("l")
j = D("j")

a.x = m
a.t = m
a.w = m
k.q = l
k.y = m
k.o = d
k.r = d
k.w = c
m.s = g
m.z = g
m.t = j
g.t = c
g.q = a
d.t = a
c.s = k
c.x = g
c.z = l
c.t = m
c.r = j
l.q = k
l.y = m
l.o = d
l.r = d
l.w = c
j.t = c
j.q = a
assert c.t.s.q.x.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: C = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: C = None
        self.o: E = None
        self.w: F = None
        self.r: E = None
        self.txt = txt

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

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

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

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

a = A("a")
k = B("k")
m = C("m")
g = D("g")
d = E("d")
c = F("c")
l = B("l")
j = D("j")

a.x = m
a.t = m
a.w = m
k.q = l
k.y = m
k.o = d
k.r = d
k.w = c
m.s = g
m.z = g
m.t = j
g.t = c
g.q = a
d.t = a
c.s = k
c.x = g
c.z = l
c.t = m
c.r = j
l.q = k
l.y = m
l.o = d
l.r = d
l.w = c
j.t = c
j.q = a
assert c.t.s.q.x.s.txt == "g"