class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: D = None
        self.t: C = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

g = A("g")
h = B("h")
j = C("j")
a = D("a")
d = E("d")
l = F("l")

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

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

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

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

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

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

g = A("g")
h = B("h")
j = C("j")
a = D("a")
d = E("d")
l = F("l")

g.o = l
g.x = l
g.s = a
g.t = j
h.z = a
j.r = l
j.t = l
j.x = d
j.q = d
a.z = l
a.p = l
a.v = l
a.t = h
a.u = j
d.x = h
d.v = h
d.z = g
l.v = a
l.p = h
l.t = j
l.q = j
l.s = j
assert l.t.x.v.txt == "h"