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

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: E = None
        self.p: F = None
        self.z: G = None
        self.s: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: E = None
        self.p: F = None
        self.z: G = None
        self.s: A = None
        self.txt = txt

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

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