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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: G = None
        self.u: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: C = None
        self.x: A = None
        self.v: F = None
        self.u: D = None
        self.o: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: G = None
        self.u: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: C = None
        self.x: A = None
        self.v: F = None
        self.u: D = None
        self.o: F = None
        self.txt = txt

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

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