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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: E = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: D = None
        self.z: F = None
        self.w: C = None
        self.r: A = None
        self.o: G = None
        self.s: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: E = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: D = None
        self.z: F = None
        self.w: C = None
        self.r: A = None
        self.o: G = None
        self.s: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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