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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: A = None
        self.p: F = None
        self.v: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: E = None
        self.v: D = None
        self.r: A = None
        self.txt = txt

l = A("l")
i = B("i")
f = C("f")
d = D("d")
b = E("b")
h = F("h")
a = F("a")

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: A = None
        self.p: F = None
        self.v: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: E = None
        self.v: D = None
        self.r: A = None
        self.txt = txt

l = A("l")
i = B("i")
f = C("f")
d = D("d")
b = E("b")
h = F("h")
a = F("a")

l.r = b
l.v = d
l.p = h
l.u = f
l.s = a
i.w = f
i.y = l
i.p = h
i.v = a
f.x = h
f.v = l
d.w = a
b.y = d
b.q = d
h.q = i
h.t = b
h.v = d
h.r = l
a.q = i
a.t = b
a.v = d
a.r = l
assert d.w.q.y.u.x.txt == "h"