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

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

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

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

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

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

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

l.p = d
l.r = e
l.u = g
l.y = a
e.w = l
e.p = k
e.z = a
d.x = l
d.t = l
d.q = a
d.s = k
d.w = e
g.s = d
g.w = e
g.u = l
a.q = g
j.x = a
j.w = a
j.v = g
k.x = a
k.w = a
k.v = g
n.x = a
n.w = a
n.v = g
assert n.v.s.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: B = None
        self.u: D = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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

l.p = d
l.r = e
l.u = g
l.y = a
e.w = l
e.p = k
e.z = a
d.x = l
d.t = l
d.q = a
d.s = k
d.w = e
g.s = d
g.w = e
g.u = l
a.q = g
j.x = a
j.w = a
j.v = g
k.x = a
k.w = a
k.v = g
n.x = a
n.w = a
n.v = g
assert n.v.s.s.v.txt == "g"