class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: D = None
        self.t: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: H = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: E = None
        self.u: A = None
        self.v: D = None
        self.w: F = None
        self.o: H = None
        self.z: A = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: A = None
        self.u: D = None
        self.y: D = None
        self.x: G = None
        self.o: G = None
        self.t: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.r: A = None
        self.q: C = None
        self.x: B = None
        self.z: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: C = None
        self.s: D = None
        self.p: F = None
        self.o: F = None
        self.y: D = None
        self.v: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: H = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: E = None
        self.u: A = None
        self.v: D = None
        self.w: F = None
        self.o: H = None
        self.z: A = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: A = None
        self.u: D = None
        self.y: D = None
        self.x: G = None
        self.o: G = None
        self.t: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.r: A = None
        self.q: C = None
        self.x: B = None
        self.z: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: C = None
        self.s: D = None
        self.p: F = None
        self.o: F = None
        self.y: D = None
        self.v: D = None
        self.txt = txt

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

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