class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: A = None
        self.u: B = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: F = None
        self.s: B = None
        self.v: D = None
        self.w: C = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: E = None
        self.p: A = None
        self.txt = txt

d = A("d")
j = B("j")
b = C("b")
a = D("a")
k = E("k")
l = F("l")

d.r = l
d.y = l
j.u = l
j.r = l
j.v = k
j.z = k
b.w = a
b.r = d
b.u = j
b.q = k
a.w = j
a.p = j
a.o = k
a.q = k
a.v = l
a.z = d
k.u = l
k.y = l
k.s = j
k.o = j
k.v = a
k.w = b
l.y = j
l.z = k
l.p = d
assert b.w.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: A = None
        self.u: B = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: F = None
        self.s: B = None
        self.v: D = None
        self.w: C = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: E = None
        self.p: A = None
        self.txt = txt

d = A("d")
j = B("j")
b = C("b")
a = D("a")
k = E("k")
l = F("l")

d.r = l
d.y = l
j.u = l
j.r = l
j.v = k
j.z = k
b.w = a
b.r = d
b.u = j
b.q = k
a.w = j
a.p = j
a.o = k
a.q = k
a.v = l
a.z = d
k.u = l
k.y = l
k.s = j
k.o = j
k.v = a
k.w = b
l.y = j
l.z = k
l.p = d
assert b.w.z.r.txt == "l"