class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: D = None
        self.u: D = None
        self.x: G = None
        self.v: F = None
        self.y: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: A = None
        self.w: F = None
        self.p: A = None
        self.r: B = None
        self.o: F = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

e = A("e")
m = B("m")
b = C("b")
l = D("l")
d = E("d")
n = F("n")
h = G("h")
k = A("k")
c = B("c")
j = F("j")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: A = None
        self.w: F = None
        self.p: A = None
        self.r: B = None
        self.o: F = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

e = A("e")
m = B("m")
b = C("b")
l = D("l")
d = E("d")
n = F("n")
h = G("h")
k = A("k")
c = B("c")
j = F("j")

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