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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: B = None
        self.o: C = None
        self.s: F = None
        self.z: G = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: B = None
        self.o: C = None
        self.s: F = None
        self.z: G = None
        self.txt = txt

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

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

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

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

f.q = h
f.x = h
f.u = c
f.w = k
a.z = i
a.y = f
c.o = d
d.p = f
d.q = a
d.o = c
d.s = k
d.z = b
i.x = b
h.v = i
h.q = c
b.u = e
b.x = d
b.q = d
e.u = b
e.x = d
e.q = d
k.v = i
k.q = c
m.v = i
m.q = c
assert e.q.s.q.o.p.w.q.o.o.o.txt == "d"