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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: C = None
        self.r: C = None
        self.s: D = None
        self.txt = txt

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

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

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

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

d = A("d")
h = B("h")
l = C("l")
m = D("m")
k = E("k")
c = F("c")

d.z = k
d.v = c
d.w = h
h.t = k
h.x = l
h.r = l
h.s = m
l.v = c
l.o = k
l.p = m
m.w = l
m.p = c
m.v = c
m.s = k
m.q = k
k.z = c
c.v = h
assert k.z.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: F = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: C = None
        self.r: C = None
        self.s: D = None
        self.txt = txt

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

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

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

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

d = A("d")
h = B("h")
l = C("l")
m = D("m")
k = E("k")
c = F("c")

d.z = k
d.v = c
d.w = h
h.t = k
h.x = l
h.r = l
h.s = m
l.v = c
l.o = k
l.p = m
m.w = l
m.p = c
m.v = c
m.s = k
m.q = k
k.z = c
c.v = h
assert k.z.v.r.txt == "l"