class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.t: F = None
        self.u: E = None
        self.txt = txt

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

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

g = A("g")
b = B("b")
d = C("d")
l = D("l")
e = E("e")
h = F("h")
c = B("c")
k = A("k")

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.t: F = None
        self.u: E = None
        self.txt = txt

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

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

g = A("g")
b = B("b")
d = C("d")
l = D("l")
e = E("e")
h = F("h")
c = B("c")
k = A("k")

g.x = c
b.v = d
b.z = d
b.s = k
d.v = h
d.r = l
d.y = c
l.s = c
l.z = g
l.t = h
l.u = e
e.p = h
h.y = l
h.p = e
h.z = b
c.v = d
c.z = d
c.s = k
k.x = c
assert k.x.s.x.s.x.z.txt == "d"