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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: D = None
        self.x: A = None
        self.q: D = None
        self.p: E = None
        self.r: G = None
        self.v: F = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: G = None
        self.s: A = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: H = None
        self.w: A = None
        self.y: C = None
        self.r: H = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: D = None
        self.x: A = None
        self.q: D = None
        self.p: E = None
        self.r: G = None
        self.v: F = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: G = None
        self.s: A = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: H = None
        self.w: A = None
        self.y: C = None
        self.r: H = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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