class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: B = None
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: E = None
        self.r: B = None
        self.z: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: A = None
        self.u: E = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: E = None
        self.r: B = None
        self.z: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: A = None
        self.u: E = None
        self.z: E = None
        self.txt = txt

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

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

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