class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: D = None
        self.o: B = None
        self.u: B = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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