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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: D = None
        self.q: C = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: C = None
        self.r: F = None
        self.z: D = None
        self.t: F = None
        self.p: B = None
        self.txt = txt

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

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

l = A("l")
c = B("c")
k = C("k")
h = D("h")
j = E("j")
i = F("i")
d = D("d")
n = F("n")
g = A("g")

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: D = None
        self.q: C = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: C = None
        self.r: F = None
        self.z: D = None
        self.t: F = None
        self.p: B = None
        self.txt = txt

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

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

l = A("l")
c = B("c")
k = C("k")
h = D("h")
j = E("j")
i = F("i")
d = D("d")
n = F("n")
g = A("g")

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