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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: B = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

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

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

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

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

l.s = n
l.x = c
m.u = d
m.v = l
m.s = f
j.s = f
j.p = m
b.z = f
b.p = m
b.x = l
b.s = l
c.v = m
c.q = m
d.w = m
d.z = l
d.s = c
d.x = c
n.z = c
n.y = l
n.x = l
n.v = d
f.s = j
f.p = m
g.z = f
g.p = m
g.x = l
g.s = l
assert b.z.p.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: B = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

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

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

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

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

l.s = n
l.x = c
m.u = d
m.v = l
m.s = f
j.s = f
j.p = m
b.z = f
b.p = m
b.x = l
b.s = l
c.v = m
c.q = m
d.w = m
d.z = l
d.s = c
d.x = c
n.z = c
n.y = l
n.x = l
n.v = d
f.s = j
f.p = m
g.z = f
g.p = m
g.x = l
g.s = l
assert b.z.p.s.s.txt == "j"