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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: C = None
        self.u: B = None
        self.p: F = None
        self.r: E = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: B = None
        self.z: H = None
        self.q: B = None
        self.v: H = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: B = None
        self.x: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: C = None
        self.u: B = None
        self.p: F = None
        self.r: E = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: B = None
        self.z: H = None
        self.q: B = None
        self.v: H = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: B = None
        self.x: G = None
        self.txt = txt

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

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