class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: G = None
        self.u: D = None
        self.y: G = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: C = None
        self.txt = txt

m = A("m")
f = B("f")
j = C("j")
b = D("b")
k = E("k")
d = F("d")
c = G("c")
h = F("h")

m.w = j
m.t = b
f.o = k
j.z = k
j.u = b
j.y = c
j.w = f
j.q = d
b.z = k
b.u = k
k.o = h
k.v = h
k.t = c
k.y = c
k.u = b
d.r = m
d.x = f
d.o = h
d.s = h
d.u = j
c.x = m
c.r = j
h.r = m
h.x = f
h.o = d
h.s = d
h.u = j
assert d.x.o.o.o.r.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: G = None
        self.u: D = None
        self.y: G = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: C = None
        self.txt = txt

m = A("m")
f = B("f")
j = C("j")
b = D("b")
k = E("k")
d = F("d")
c = G("c")
h = F("h")

m.w = j
m.t = b
f.o = k
j.z = k
j.u = b
j.y = c
j.w = f
j.q = d
b.z = k
b.u = k
k.o = h
k.v = h
k.t = c
k.y = c
k.u = b
d.r = m
d.x = f
d.o = h
d.s = h
d.u = j
c.x = m
c.r = j
h.r = m
h.x = f
h.o = d
h.s = d
h.u = j
assert d.x.o.o.o.r.w.w.txt == "f"