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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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