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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: B = None
        self.z: E = None
        self.txt = txt

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

m = A("m")
d = B("d")
k = C("k")
g = D("g")
n = E("n")
j = F("j")
h = A("h")
i = A("i")
b = A("b")
a = E("a")

m.p = a
m.y = g
m.z = g
m.q = k
m.u = n
d.x = j
k.q = g
k.z = g
k.y = j
k.r = a
g.r = j
g.w = b
g.x = d
n.r = g
n.o = d
n.z = a
j.q = n
j.p = k
h.p = n
h.u = n
h.y = g
h.z = g
h.q = k
i.p = a
i.y = g
i.z = g
i.q = k
i.u = n
b.p = a
b.u = a
b.y = g
b.z = g
b.q = k
a.r = g
a.o = d
a.z = n
assert d.x.p.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: D = None
        self.q: C = None
        self.u: E = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: B = None
        self.z: E = None
        self.txt = txt

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

m = A("m")
d = B("d")
k = C("k")
g = D("g")
n = E("n")
j = F("j")
h = A("h")
i = A("i")
b = A("b")
a = E("a")

m.p = a
m.y = g
m.z = g
m.q = k
m.u = n
d.x = j
k.q = g
k.z = g
k.y = j
k.r = a
g.r = j
g.w = b
g.x = d
n.r = g
n.o = d
n.z = a
j.q = n
j.p = k
h.p = n
h.u = n
h.y = g
h.z = g
h.q = k
i.p = a
i.y = g
i.z = g
i.q = k
i.u = n
b.p = a
b.u = a
b.y = g
b.z = g
b.q = k
a.r = g
a.o = d
a.z = n
assert d.x.p.r.r.txt == "g"