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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: C = None
        self.o: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: C = None
        self.r: B = None
        self.u: D = None
        self.o: E = None
        self.txt = txt

l = A("l")
d = B("d")
g = C("g")
j = D("j")
c = E("c")
a = F("a")
f = G("f")
e = H("e")

l.u = c
l.w = f
l.x = j
d.u = e
d.x = g
d.o = g
g.q = c
j.x = f
j.y = f
j.t = f
j.u = l
j.s = c
j.r = a
j.p = d
c.y = f
a.z = d
f.w = a
f.p = j
f.s = j
f.y = l
e.t = c
e.o = c
e.p = g
e.r = d
e.u = j
assert g.q.y.p.p.o.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: G = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: C = None
        self.o: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: C = None
        self.r: B = None
        self.u: D = None
        self.o: E = None
        self.txt = txt

l = A("l")
d = B("d")
g = C("g")
j = D("j")
c = E("c")
a = F("a")
f = G("f")
e = H("e")

l.u = c
l.w = f
l.x = j
d.u = e
d.x = g
d.o = g
g.q = c
j.x = f
j.y = f
j.t = f
j.u = l
j.s = c
j.r = a
j.p = d
c.y = f
a.z = d
f.w = a
f.p = j
f.s = j
f.y = l
e.t = c
e.o = c
e.p = g
e.r = d
e.u = j
assert g.q.y.p.p.o.q.y.txt == "f"