class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: C = None
        self.z: F = None
        self.x: G = None
        self.q: C = None
        self.y: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: F = None
        self.p: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: C = None
        self.r: B = None
        self.o: B = None
        self.txt = txt

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

i.u = f
i.w = j
i.q = j
i.y = j
i.z = g
i.x = n
d.s = f
j.x = d
j.y = f
j.r = f
m.w = f
m.s = n
m.x = n
m.r = n
m.o = g
m.y = j
f.s = n
f.u = g
f.p = i
g.w = m
g.s = n
g.o = d
g.r = f
n.s = m
n.p = j
n.r = d
n.o = d
assert i.x.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: C = None
        self.z: F = None
        self.x: G = None
        self.q: C = None
        self.y: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: F = None
        self.p: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: C = None
        self.r: B = None
        self.o: B = None
        self.txt = txt

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

i.u = f
i.w = j
i.q = j
i.y = j
i.z = g
i.x = n
d.s = f
j.x = d
j.y = f
j.r = f
m.w = f
m.s = n
m.x = n
m.r = n
m.o = g
m.y = j
f.s = n
f.u = g
f.p = i
g.w = m
g.s = n
g.o = d
g.r = f
n.s = m
n.p = j
n.r = d
n.o = d
assert i.x.p.y.txt == "f"