class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: A = None
        self.w: B = None
        self.o: E = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: G = None
        self.q: D = None
        self.o: F = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: C = None
        self.s: F = None
        self.p: E = None
        self.u: E = None
        self.r: C = None
        self.y: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: A = None
        self.w: B = None
        self.o: E = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: G = None
        self.q: D = None
        self.o: F = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: C = None
        self.s: F = None
        self.p: E = None
        self.u: E = None
        self.r: C = None
        self.y: D = None
        self.txt = txt

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

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

e.x = a
n.y = b
m.x = f
h.v = m
h.u = m
h.y = e
h.w = n
h.o = f
f.u = n
f.z = b
f.q = h
f.o = a
f.y = e
a.o = m
a.x = m
a.r = m
a.s = i
a.p = f
a.u = f
a.y = h
j.p = m
i.o = m
i.x = m
i.r = m
i.s = a
i.p = f
i.u = f
i.y = h
b.p = m
assert e.x.r.x.u.y.p.x.txt == "f"