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

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: B = None
        self.v: F = None
        self.x: B = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: C = None
        self.p: C = None
        self.y: A = None
        self.u: C = None
        self.z: A = None
        self.txt = txt

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

l = A("l")
i = B("i")
f = C("f")
c = D("c")
h = E("h")
a = F("a")
j = F("j")

l.w = c
l.p = h
i.u = l
f.z = c
f.s = c
f.u = l
f.t = a
f.y = h
f.x = i
c.z = i
c.r = i
c.x = i
c.w = i
c.v = a
h.s = j
h.r = f
h.p = f
h.u = f
h.y = l
h.z = l
a.u = f
a.p = c
j.u = f
j.p = c
assert j.p.r.u.p.z.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: B = None
        self.v: F = None
        self.x: B = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: C = None
        self.p: C = None
        self.y: A = None
        self.u: C = None
        self.z: A = None
        self.txt = txt

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

l = A("l")
i = B("i")
f = C("f")
c = D("c")
h = E("h")
a = F("a")
j = F("j")

l.w = c
l.p = h
i.u = l
f.z = c
f.s = c
f.u = l
f.t = a
f.y = h
f.x = i
c.z = i
c.r = i
c.x = i
c.w = i
c.v = a
h.s = j
h.r = f
h.p = f
h.u = f
h.y = l
h.z = l
a.u = f
a.p = c
j.u = f
j.p = c
assert j.p.r.u.p.z.p.s.txt == "j"