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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: H = None
        self.u: C = None
        self.v: I = None
        self.p: E = None
        self.z: H = None
        self.q: A = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: G = None
        self.r: A = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: H = None
        self.u: C = None
        self.v: I = None
        self.p: E = None
        self.z: H = None
        self.q: A = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: G = None
        self.r: A = None
        self.w: B = None
        self.txt = txt

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

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