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

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

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

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

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

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

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

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

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

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

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

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

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

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

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