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

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: A = None
        self.o: F = None
        self.x: D = None
        self.txt = txt

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

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

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

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

k.x = f
k.q = e
k.v = h
k.z = h
k.p = l
f.q = c
f.r = c
h.u = l
h.w = b
h.o = j
h.x = e
e.o = h
e.s = d
l.v = c
d.q = j
d.s = e
d.y = e
d.z = f
i.u = l
i.w = k
i.o = j
i.x = e
j.q = d
j.s = e
j.y = e
j.z = c
b.x = c
b.q = e
b.v = h
b.p = l
b.z = i
c.q = f
c.r = f
assert i.o.s.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: D = None
        self.v: C = None
        self.p: E = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: A = None
        self.o: F = None
        self.x: D = None
        self.txt = txt

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

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

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

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

k.x = f
k.q = e
k.v = h
k.z = h
k.p = l
f.q = c
f.r = c
h.u = l
h.w = b
h.o = j
h.x = e
e.o = h
e.s = d
l.v = c
d.q = j
d.s = e
d.y = e
d.z = f
i.u = l
i.w = k
i.o = j
i.x = e
j.q = d
j.s = e
j.y = e
j.z = c
b.x = c
b.q = e
b.v = h
b.p = l
b.z = i
c.q = f
c.r = f
assert i.o.s.s.q.txt == "j"