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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: E = None
        self.z: G = None
        self.q: E = None
        self.x: A = None
        self.y: C = None
        self.s: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: E = None
        self.t: A = None
        self.o: D = None
        self.w: F = None
        self.s: F = None
        self.txt = txt

f = A("f")
j = B("j")
a = C("a")
b = D("b")
l = E("l")
e = F("e")
n = G("n")

f.p = j
f.s = j
f.x = b
j.s = a
j.p = b
j.z = l
a.y = f
b.v = a
b.y = a
b.s = a
b.t = l
b.q = l
b.z = n
b.x = f
l.o = f
e.z = j
e.r = l
n.y = f
n.t = f
n.x = l
n.o = b
n.w = e
n.s = e
assert l.o.x.z.t.s.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: E = None
        self.z: G = None
        self.q: E = None
        self.x: A = None
        self.y: C = None
        self.s: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: E = None
        self.t: A = None
        self.o: D = None
        self.w: F = None
        self.s: F = None
        self.txt = txt

f = A("f")
j = B("j")
a = C("a")
b = D("b")
l = E("l")
e = F("e")
n = G("n")

f.p = j
f.s = j
f.x = b
j.s = a
j.p = b
j.z = l
a.y = f
b.v = a
b.y = a
b.s = a
b.t = l
b.q = l
b.z = n
b.x = f
l.o = f
e.z = j
e.r = l
n.y = f
n.t = f
n.x = l
n.o = b
n.w = e
n.s = e
assert l.o.x.z.t.s.s.y.txt == "f"