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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: G = None
        self.t: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: G = None
        self.t: H = None
        self.txt = txt

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

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

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

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

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

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

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