class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: F = None
        self.v: F = None
        self.o: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: E = None
        self.r: A = None
        self.z: F = None
        self.s: D = None
        self.txt = txt

b = A("b")
j = B("j")
n = C("n")
d = D("d")
a = E("a")
c = F("c")
g = G("g")
l = C("l")

b.w = c
b.z = c
b.v = c
b.o = j
b.u = n
j.v = c
j.x = c
j.w = g
n.w = b
n.o = a
d.r = g
d.t = g
a.u = j
a.y = j
c.r = b
c.p = a
c.s = n
g.o = l
g.w = a
g.r = b
g.z = c
g.s = d
l.w = b
l.o = a
assert j.w.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: F = None
        self.v: F = None
        self.o: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: E = None
        self.r: A = None
        self.z: F = None
        self.s: D = None
        self.txt = txt

b = A("b")
j = B("j")
n = C("n")
d = D("d")
a = E("a")
c = F("c")
g = G("g")
l = C("l")

b.w = c
b.z = c
b.v = c
b.o = j
b.u = n
j.v = c
j.x = c
j.w = g
n.w = b
n.o = a
d.r = g
d.t = g
a.u = j
a.y = j
c.r = b
c.p = a
c.s = n
g.o = l
g.w = a
g.r = b
g.z = c
g.s = d
l.w = b
l.o = a
assert j.w.s.r.txt == "g"