class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: D = None
        self.v: D = None
        self.p: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: G = None
        self.txt = txt

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

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

n.s = j
n.y = f
d.o = b
b.y = e
b.p = e
b.s = f
b.v = f
f.p = i
i.q = b
i.p = e
j.w = d
j.q = e
e.x = d
e.t = f
e.o = j
e.w = i
assert j.w.o.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: D = None
        self.v: D = None
        self.p: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: G = None
        self.txt = txt

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

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

n.s = j
n.y = f
d.o = b
b.y = e
b.p = e
b.s = f
b.v = f
f.p = i
i.q = b
i.p = e
j.w = d
j.q = e
e.x = d
e.t = f
e.o = j
e.w = i
assert j.w.o.s.p.txt == "i"