class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: F = None
        self.o: C = None
        self.q: B = None
        self.u: B = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

c.x = n
c.o = n
c.w = i
c.q = k
c.u = k
c.t = g
d.u = l
d.r = n
d.y = i
n.t = i
b.x = c
l.z = i
l.v = g
i.o = c
i.w = g
i.u = n
g.o = k
k.u = l
k.r = n
k.y = i
assert l.z.u.t.w.o.txt == "k"