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

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

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

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

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

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

h = A("h")
b = B("b")
j = C("j")
g = D("g")
n = E("n")
f = F("f")
d = F("d")
l = D("l")

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

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

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

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

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

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

h = A("h")
b = B("b")
j = C("j")
g = D("g")
n = E("n")
f = F("f")
d = F("d")
l = D("l")

h.r = g
h.y = g
h.v = n
h.z = n
h.p = d
h.q = j
b.r = f
b.u = d
b.s = d
b.v = g
b.t = l
b.y = h
j.p = f
j.w = n
j.y = b
g.s = d
g.q = n
g.z = l
g.u = b
n.p = h
n.v = d
n.x = f
f.q = h
f.y = h
f.w = h
f.u = n
f.r = n
f.p = j
d.q = h
d.y = h
d.w = h
d.u = n
d.r = n
d.p = j
l.s = d
l.q = n
l.z = g
l.u = b
assert j.w.p.p.txt == "d"