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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: F = None
        self.t: E = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: E = None
        self.y: E = None
        self.x: G = None
        self.p: B = None
        self.v: A = None
        self.txt = txt

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

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

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

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

d = A("d")
l = B("l")
k = C("k")
n = D("n")
f = E("f")
a = F("a")
c = G("c")
h = F("h")
g = G("g")

d.w = n
d.r = a
l.s = k
l.r = a
l.t = f
l.v = f
k.s = f
k.r = f
k.y = f
k.x = c
k.p = l
k.v = d
n.x = g
n.w = g
n.t = f
n.y = a
n.o = d
n.q = k
f.t = h
f.s = l
f.r = n
f.u = n
f.q = c
a.x = n
a.w = l
a.s = h
a.u = d
c.w = g
c.r = g
c.t = h
c.q = l
h.x = n
h.w = l
h.s = a
h.u = d
g.w = c
g.r = c
g.t = a
g.q = l
assert h.w.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: F = None
        self.t: E = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: E = None
        self.y: E = None
        self.x: G = None
        self.p: B = None
        self.v: A = None
        self.txt = txt

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

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

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

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

d = A("d")
l = B("l")
k = C("k")
n = D("n")
f = E("f")
a = F("a")
c = G("c")
h = F("h")
g = G("g")

d.w = n
d.r = a
l.s = k
l.r = a
l.t = f
l.v = f
k.s = f
k.r = f
k.y = f
k.x = c
k.p = l
k.v = d
n.x = g
n.w = g
n.t = f
n.y = a
n.o = d
n.q = k
f.t = h
f.s = l
f.r = n
f.u = n
f.q = c
a.x = n
a.w = l
a.s = h
a.u = d
c.w = g
c.r = g
c.t = h
c.q = l
h.x = n
h.w = l
h.s = a
h.u = d
g.w = c
g.r = c
g.t = a
g.q = l
assert h.w.r.u.txt == "d"