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

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: B = None
        self.q: E = None
        self.p: B = None
        self.v: A = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: A = None
        self.txt = txt

n = A("n")
d = B("d")
l = C("l")
j = D("j")
c = E("c")
m = F("m")
i = G("i")

n.s = c
n.x = c
n.u = d
d.o = c
d.z = j
d.q = j
d.r = m
l.x = i
j.u = i
c.o = j
c.r = l
c.p = n
c.w = d
c.q = m
m.s = n
m.v = n
m.t = n
m.r = d
m.p = d
m.q = c
i.y = d
i.u = n
assert d.q.u.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: B = None
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: B = None
        self.q: E = None
        self.p: B = None
        self.v: A = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: A = None
        self.txt = txt

n = A("n")
d = B("d")
l = C("l")
j = D("j")
c = E("c")
m = F("m")
i = G("i")

n.s = c
n.x = c
n.u = d
d.o = c
d.z = j
d.q = j
d.r = m
l.x = i
j.u = i
c.o = j
c.r = l
c.p = n
c.w = d
c.q = m
m.s = n
m.v = n
m.t = n
m.r = d
m.p = d
m.q = c
i.y = d
i.u = n
assert d.q.u.y.q.txt == "j"