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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: G = None
        self.q: D = None
        self.r: H = None
        self.w: C = None
        self.x: C = None
        self.y: G = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: F = None
        self.t: E = None
        self.txt = txt

i = A("i")
m = B("m")
j = C("j")
l = D("l")
f = E("f")
h = F("h")
b = G("b")
n = H("n")
c = C("c")
d = G("d")

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: G = None
        self.q: D = None
        self.r: H = None
        self.w: C = None
        self.x: C = None
        self.y: G = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: F = None
        self.t: E = None
        self.txt = txt

i = A("i")
m = B("m")
j = C("j")
l = D("l")
f = E("f")
h = F("h")
b = G("b")
n = H("n")
c = C("c")
d = G("d")

i.u = h
i.q = h
m.v = i
j.p = f
j.r = l
j.w = b
j.u = d
j.z = d
j.q = c
j.x = i
l.z = m
l.p = c
f.p = i
f.s = c
f.o = m
f.t = b
f.q = h
f.v = d
f.x = l
h.q = n
h.s = c
b.o = i
b.p = d
b.y = d
b.q = l
b.r = n
b.w = j
b.x = c
b.t = f
n.u = j
n.s = h
n.t = f
c.p = f
c.r = l
c.w = d
c.u = d
c.z = d
c.q = j
c.x = i
d.o = i
d.p = b
d.y = b
d.q = l
d.r = n
d.w = j
d.x = j
d.t = f
assert d.q.z.v.q.q.t.txt == "f"