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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

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