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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: F = None
        self.p: D = None
        self.t: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: D = None
        self.u: E = None
        self.txt = txt

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

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

g = A("g")
e = B("e")
a = C("a")
b = D("b")
d = E("d")
c = F("c")
m = G("m")
n = H("n")
k = A("k")

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: F = None
        self.p: D = None
        self.t: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: D = None
        self.u: E = None
        self.txt = txt

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

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

g = A("g")
e = B("e")
a = C("a")
b = D("b")
d = E("d")
c = F("c")
m = G("m")
n = H("n")
k = A("k")

g.r = k
g.x = n
g.u = e
g.o = d
g.q = c
g.s = b
e.w = b
e.p = b
e.z = c
e.t = n
a.q = g
a.s = n
a.t = m
b.r = c
b.p = c
b.o = g
d.u = b
d.s = n
c.v = a
c.w = b
c.u = d
m.x = d
m.w = b
n.p = d
n.t = b
k.r = g
k.x = n
k.u = e
k.o = d
k.q = c
k.s = b
assert e.z.v.q.o.s.p.txt == "d"