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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: C = None
        self.p: G = None
        self.o: A = None
        self.r: C = None
        self.w: A = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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

n.p = a
n.o = a
h.t = d
h.p = d
h.u = a
h.r = a
h.o = n
h.w = n
h.s = e
a.w = n
a.y = j
j.v = h
j.r = e
e.v = n
e.s = j
f.z = h
f.w = h
d.x = j
d.y = j
d.o = n
d.s = a
assert d.o.o.y.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: C = None
        self.p: G = None
        self.o: A = None
        self.r: C = None
        self.w: A = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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

n.p = a
n.o = a
h.t = d
h.p = d
h.u = a
h.r = a
h.o = n
h.w = n
h.s = e
a.w = n
a.y = j
j.v = h
j.r = e
e.v = n
e.s = j
f.z = h
f.w = h
d.x = j
d.y = j
d.o = n
d.s = a
assert d.o.o.y.v.s.txt == "e"