class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: B = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: A = None
        self.t: G = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

n = A("n")
g = B("g")
e = C("e")
h = D("h")
c = E("c")
m = F("m")
d = G("d")
f = B("f")
j = F("j")

n.q = g
n.w = g
n.y = g
g.z = d
g.t = d
g.o = n
g.x = f
e.o = h
e.s = g
h.w = n
h.p = d
c.o = e
c.y = f
c.v = g
m.y = h
m.w = c
m.u = j
d.y = n
d.u = m
f.z = d
f.t = d
f.o = n
f.x = g
j.y = h
j.w = c
j.u = m
assert j.u.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: B = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: A = None
        self.t: G = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

n = A("n")
g = B("g")
e = C("e")
h = D("h")
c = E("c")
m = F("m")
d = G("d")
f = B("f")
j = F("j")

n.q = g
n.w = g
n.y = g
g.z = d
g.t = d
g.o = n
g.x = f
e.o = h
e.s = g
h.w = n
h.p = d
c.o = e
c.y = f
c.v = g
m.y = h
m.w = c
m.u = j
d.y = n
d.u = m
f.z = d
f.t = d
f.o = n
f.x = g
j.y = h
j.w = c
j.u = m
assert j.u.w.y.txt == "f"