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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: C = None
        self.y: F = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: C = None
        self.y: F = None
        self.r: C = None
        self.txt = txt

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

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

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